<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input id="id" name="id" th:value="${mpArticle.id}" type="hidden">

                        <div class="form-group">
                            <label class="col-sm-3 control-label">关键字</label>
                            <div class="col-sm-8">
                                <input id="keyword" name="keyword" th:value="${mpArticle.keyword}" class="form-control" type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">标题</label>
                            <div class="col-sm-8">
                                <input id="title" name="title" th:value="${mpArticle.title}" class="form-control" type="text">
                            </div>
                        </div>
                        <style>
                            #btnUpload{
                                margin-top: 10px;
                            }
                            .layui-upload-file {
                                display: none!important;
                                opacity: .01;
                                filter: Alpha(opacity=1);
                            }
                        </style>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">封面图片：</label>
                            <div class="col-sm-8">
                                <img id="imgLogo" alt="公众号logo" src="" th:src="@{${mpArticle.imgurl}}" style="width:100px;display:block;">
                                <input type="hidden" id="logo" name="imgurl" th:value="${mpArticle.imgurl}" >
                                <button type="button" class="btn btn-success" id="btnUpload">
                                    <i class="fa fa-cloud"></i>上传文件
                                </button>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">状态</label>
                            <div class="col-sm-9">
                                <label class="radio-inline" for="appType1">
                                    <input type="radio" value="1" th:checked="${mpArticle.status == '1'}" id="appType1" name="status"> 启用
                                </label>
                                <label class="radio-inline" for="appType2">
                                    <input type="radio" value="2" th:checked="${mpArticle.status == '2'}" id="appType2" name="status"> 停用
                                </label>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">排序</label>
                            <div class="col-sm-8">
                                <input id="sort" name="sort" th:value="${mpArticle.sort}" class="form-control"
                                       type="text">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">摘要</label>
                            <div class="col-sm-8">
                                <textarea id="introduct" name="introduct"  th:text="${mpArticle.introduct}"  class="form-control" rows="5"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">内容</label>
                            <div class="col-sm-8">
                                <textarea id="content" name="content"  th:text="${mpArticle.content}"  class="form-control" rows="5"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">外链</label>
                            <div class="col-sm-8">
                                <input id="url" name="url" th:value="${mpArticle.url}" class="form-control" type="text">
                            </div>
                        </div>


                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button type="submit" class="btn btn-primary">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script src="//s.xlongwei.com/res/js/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript" src="/js/appjs/wxmp/mpArticleNews/edit.js"></script>
<script src="/js/layui.js"></script>
<script type="text/javascript">
    layui.use('upload', function () {
        var upload = layui.upload;
        //执行实例
        var uploadInst = upload.render({
            elem: '#btnUpload', //绑定元素
            url: '/common/sysFile/upload', //上传接口
            size: 1000,
            accept: 'file',
            done: function (r) {
                $("#imgLogo").attr("src", r.data)
                $("#logo").val(r.data)
            },
            error: function (r) {
                layer.msg(r.msg);
            }
        });
    });
</script>
</body>
</html>
